<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<html lang="zh-cn">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    
    <title> 电子书籍管理平台  </title> 
    <jsp:include page="../../common/jsp/imp_bootstrap_ui.jsp"></jsp:include>
   <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/css/pintuer.css">
    <link rel="stylesheet"
	href="${pageContext.request.contextPath}/admin/css/admin.css">
    <script src="${pageContext.request.contextPath}/admin/js/pintuer.js"></script>
   
</head>
<body>
<div class="bg"></div>
<div class="container">
    <div class="line bouncein">
        <div class="xs6 xm4 xs3-move xm4-move">
            <div style="height:150px;"></div>
            <div class="media media-y margin-big-bottom">           
            </div>
            <form id="loginForm">
            <div class="panel loginbox">
                <div class="text-center margin-big padding-big-top"><h1>电子书籍管理平台</h1></div>
                <div class="panel-body" style="padding:30px; padding-bottom:10px; padding-top:10px;">
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="text" id="userName" class="input input-big" name="name" placeholder="登录账号" data-validate="required:请填写账号" />
                            <span class="icon icon-user margin-small"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="password" id="password" class="input input-big" name="password" placeholder="登录密码" data-validate="required:请填写密码" />
                            <span class="icon icon-key margin-small"></span>
                        </div>
                    </div>
                   </div>
                <div style="padding:30px;"><input id="login_btn" type="button" class="button button-block bg-main text-big input-big" value="登录"></div>
            </div>
            </form>          
        </div>
    </div>
</div>
</body>

<script type="text/javascript">
	//加载全局页面
	$(function(){
		//点击登录按钮操作
		$("#login_btn").click(function(){
			console.log("执行登录操作");
			doLogin();
		});
	});	
	//加载执行登录操作
	function doLogin(){
		//获取用户名和密码	
		var userName = $("#userName").val();
		var password = $("#password").val();
		console.log("登录用户名："+userName+" -- 登录密码："+password);
		//执行ajax操作
		$.ajax({
		 	type:'post',
		 	url:'${pageContext.request.contextPath}/doLogin',
		 	data:{userName:userName,password:password},
		 	dataType:'json',
		 	cache:false,
		 	success:function(data)
		 	{	
		 		if(data.success)
		 		{
		 			window.location.href="${pageContext.request.contextPath}/main";
		 		}
		 		else
		 		{
		 			alert(data.message);
		 			//window.location.href="${pageContext.request.contextPath}/";
		 		}
		 	},
		 	error:function(data)
		 	{
		 		alert('系统出现异常!');
		 	}
		});
	}
	
	//操作检查登录操作参数以及客户端加载
	function checkLogin(){
		
	
	}
</script>


</html>